module.exports = {
  apps: [
    {
      name: 'neighborhood-help-backend',
      script: './server.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '1G',
      env: {
        NODE_ENV: 'development',
      },
      env_production: {
        NODE_ENV: 'production',
      },
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: './logs/err.log',
      out_file: './logs/out.log',
      combine_logs: true,
      merge_logs: true,
      // 延迟启动，确保数据库服务已启动
      wait_ready: true,
      listen_timeout: 5000
    }
  ]
};